package com.whcoding.task.xxl.job.task.base;

import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.IJobHandler;
import com.xxl.job.core.log.XxlJobLogger;

public abstract class TaskIJobHandler extends IJobHandler {

    public abstract void doTask(String param);

    @Override
    public ReturnT<String> execute(String param) throws Exception {
        try {
            doTask(param);
        } catch (Exception e) {
            XxlJobLogger.log(e);
            return ReturnT.FAIL;
        }
        return ReturnT.SUCCESS;
    }
}